#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
int a[N];
void solve() {
  cin >> n >> m;
  rep(i, 1, n) cin >> a[i];
  deque<int> mn;
  deque<int> mx;
  vector<pii> ans;
  int len = 0;
  int l = 1;
  rep(r, 1, n) {
    if (mn.size() && a[mn.front()] + m < a[r]) {
      while (mn.size() && a[mn.front()] + m < a[r]) {
        l = mn.front() + 1;
        mn.pop_front();
      }
      while (mx.size() && mx.front() < l) mx.pop_front();
    } else if (mx.size() && a[mx.front()] > m + a[r]) {
      while (mx.size() && a[mx.front()] > m + a[r]) {
        l = mx.front() + 1;
        mx.pop_front();
      }
      while (mn.size() && mn.front() < l) mn.pop_front();
    }
    while (mn.size() && a[mn.back()] >= a[r]) mn.pop_back();
    mn.push_back(r);
    while (mx.size() && a[mx.back()] <= a[r]) mx.pop_back();
    mx.push_back(r);
    int now = r + 1 - l;
    if (now > len) ans.clear(), len = now;
    if (now == len) ans.push_back(pii(l, r));
  }
  cout << len << ' ' << ans.size() << endl;
  for (pii p : ans) cout << p.first << ' ' << p.second << endl;
  return;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  t = 1;
  while (t--) solve();
  return 0;
}